-
Notifications
You must be signed in to change notification settings - Fork 235
feat: provide de-duplicated secondary resources stream on Context #3141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
...-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/DefaultContext.java
Show resolved
Hide resolved
...-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/DefaultContext.java
Outdated
Show resolved
Hide resolved
...mework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ResourceOperations.java
Outdated
Show resolved
Hide resolved
csviri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some minor comments, pls add unit tests! Otherwise looks great, thank you!!
|
|
||
| default <R> Stream<R> getSecondaryResourcesAsStream(Class<R> expectedType) { | ||
| return getSecondaryResources(expectedType).stream(); | ||
| return getSecondaryResourcesAsStream(expectedType, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we could use the former implementation and call this in case in the new method the deduplication is false.
...-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/DefaultContext.java
Show resolved
Hide resolved
...-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/DefaultContext.java
Show resolved
Hide resolved
fdfaa63 to
3c9de5c
Compare
| } | ||
| return stream | ||
| .collect( | ||
| Collectors.toUnmodifiableMap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end, I couldn't make the implementation work without collecting to Map, I iterated over the code and ended collecting manually…
28328fb to
afa2dc8
Compare
Signed-off-by: Chris Laprun <metacosm@gmail.com>
afa2dc8 to
7158917
Compare
Alternative to #3130, to discuss